import { get } from '../utils/request';
import { API_URLS } from './config';
// import type { ApiResponse } from '../types/api';

export interface PublishData {
  downloads: number;
  created: number;
  collected: number;
}

export interface WorkItem {
  id: number;
  type: string;
  typeLabel: string;
  status: string;
  cover: string;
  title: string;
  date: string;
  views: number;
  visitors: number;
  typeTag: string;
  duration?: string;
}

/**
 * 获取发布数据
 * @returns Promise<PublishData>
 */
export const getPublishData = () => {
  return get<PublishData>(API_URLS.workbench.publishData);
};

/**
 * 获取工作列表
 * @returns Promise<WorkItem[]>
 */
export const getWorkList = () => {
  return get<WorkItem[]>(API_URLS.workbench.workList);
}; 